﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Daemon.Common.Generator
{
	public class GeneratorCodeFactory
	{
		~GeneratorCodeFactory() { }

		private static Dictionary<WidgetTypeEnum, ComponentGenerator> componentGeneratorMap = new Dictionary<WidgetTypeEnum, ComponentGenerator>()
		{
			{ WidgetTypeEnum.Input, new InputComponentGenerator()},
			{ WidgetTypeEnum.Select, new SelectComponentGenerator()},
			{ WidgetTypeEnum.UploadImg, new UploadImgComponentGenerator()},
			{ WidgetTypeEnum.TextEditor, new TextEditorComponentGenerator() },
		};

		public static ComponentGenerator GetGenerator(WidgetTypeEnum widgetTypeEnum)
		{
			return componentGeneratorMap[widgetTypeEnum];
		}
	}
}
